import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * @description 收藏or取消收藏帖子
 * @param query {
  "type": "collect或者uncollect",
   "authorId": "文章用户的id"
  "postsId": "文章id"
}
 * @returns 
 */
export const collectPosts = (query?: any,headers?:any): AxiosPromise<any> => {
    return request({
      url: '/api/collect/posts',
      method: 'post',
      data: query,
      headers:headers
    });
};

/**
 * @description 收藏or取消收藏钓场
 * @param query {
  "type": "collect或者uncollect",
  "fishSiteId": "钓点id"
}
 * @returns 
 */
export const collectFishSite = (query?: any): AxiosPromise<any> => {
    return request({
      url: '/api/collect/fishSite',
      method: 'post',
      data: query
    });
};